#include <wild/WildConfig.h>
#include "wild/PlatformMgr.h"
#include "wild/SceneRoleMgr.h"




//using namespace std;


namespace wild
{

//-----------------------------------------------------------------------------------------------------
Platform::Platform() 
: _bFullScreen(false)
{

}


//-----------------------------------------------------------------------------------------------------
bool Platform::Initialize()
{

	return OnConfigure();
}

//-----------------------------------------------------------------------------------------------------
void Platform::Finialize()
{
	_oSceneList.Clear();

	OnStop();
}

//-----------------------------------------------------------------------------------------------------
void Platform::Start()
{
	OnStart();
}

//-----------------------------------------------------------------------------------------------------
void Platform::Stop()
{
	OnStop();
}

//-----------------------------------------------------------------------------------------------------
void Platform::UpdateFrame()
{
	SceneRoleMgr* p_ = _oSceneList.ToHeadPtr();

	while(p_)
	{
		p_->OnUpdateFrame();

		p_ = _oSceneList.ToNextPtr();
	}

	OnUpdate();
}

//-----------------------------------------------------------------------------------------------------
bool Platform::RemoveSceneRoleMgr(int iID)
{
	SceneRoleMgr* poMgr_ = _oSceneList.GetObjectByID(iID);
	if(!poMgr_)
		return false;


	poMgr_->Stop();

	_oSceneList.Remove(iID);

	

	return true;
}

//-----------------------------------------------------------------------------------------------------
SceneRoleMgr* Platform::GetRoleMgr(int iID)
{
	return _oSceneList.GetObjectByID(iID);
}



//-----------------------------------------------------------------------------------------------------
bool Platform::SetNowUseScene(int iID)
{


	SceneRoleMgr* poSc_ = GetRoleMgr(iID);
	if(!poSc_)
		return false;




	return true;
}

}	//	namespace wild
